<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .btn {
            width: 120px;
            background-color: red;
            padding: 1%;
            border-radius: 5px;
            color: #fff;
            text-align: center;
            cursor: pointer;
        }

        .btns {
      
            width: 120px;
            background-color: red;
            padding: 1%;
            border-radius: 5px;
            color: #fff;
            text-align: center;
            cursor: pointer;
        }
    </style>
    <script>
        const btn = document.querySelector('.btn');
        const btns = document.querySelector('.btns');
        btn.onmouseover = function () {
            btns.style.height = "auto";
            const { height } = btns.getBoundingClientRect();
            btns.style.height = 0;
            btns.style.transition = "height 0.5s";
            btns.offsetHeight;
            btns.style.height = `${height}px`;
        }

    </script>

</head>

<body>
    <div class="btn">
        hover hover
        <div class="btns">
            homer hover
            homer hover
            homer hover
            homer hover
            homer hover
            homer hover
            homer hover homer hover
        </div>
    </div>
    
</body>

</html>